# -*- coding: utf-8 -*-

import client.extraClientApi as clientApi
ClientSystem = clientApi.GetClientSystemCls()
from awesomeScripts.modCommon import modConfig
from awesomeScripts.modClient import logger


class FpsClientSystem(ClientSystem):

    def __init__(self, namespace, systemName):
        ClientSystem.__init__(self, namespace, systemName)
        logger.info("===== Client Listen =====")
        self.ListenEvent()

    def ListenEvent(self):

        self.ListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), modConfig.ClientChatEvent, self, self.Gameer)


    def UnListenEvent(self):
        self.UnListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), modConfig.ClientChatEvent, self, self.Gameer)


    def Gameer(self):
        comp =self.CreateComponent(clientApi.GetLevelId, modConfig.ClientSystemName, modConfig.GameComponent)
        # 游戏类型获取：
        comp.gameType
        comp.msg = "12312345123"

    def Destroy(self):
            logger.info("===== Fps Client System Destroy =====")
            self.UnListenEvent()